package com.java.lesson.lesson3;

public class People {
    //类中的成员属性
    private int age;//年龄
    private String name;//名字
    private double lenght;//身高

    //类中的成员方法
    public void move() {
        System.out.println("方法1");
    }
    public void move(int a) {
        System.out.println("方法重载2");
    }
    public float move(float b) {
        System.out.println("方法重载3");
        return b;
    }
    public void sleep() {
        System.out.println("日出而作日落而息");
    }

    public static void main(String[] args) {
        //创建类的实例对象 可以调用类中的属性和方法
        People p1 = new People();//
        p1.name = "亚当";
        p1.age=30;
        p1.lenght=1.85;
        System.out.println("这个人类的名字是"+p1.name);
        System.out.println("这个人类的年龄是"+p1.age);
        System.out.println("这个人类的身高是"+p1.lenght+"m");
        p1.move();
        p1.sleep();
    }

    public People() {
    }

    public People(int age, String name, double lenght) {
        this.age = age;
        this.name = name;
        this.lenght = lenght;
    }

    public People(int age, String name) {
        this.age = age;
        this.name = name;
    }

    public People(String name, double lenght) {
        this.name = name;
        this.lenght = lenght;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public double getLenght() {
        return lenght;
    }

    public void setLenght(double lenght) {
        this.lenght = lenght;
    }
}
